package homework9package;

import java.util.HashMap;
import java.util.HashSet;

/**
 * Index class
 * 
 * 
 * this class represents a single database for our index
 * 
 * 
 * @author Orion Taylor
 * @course Software Engineering
 * @date 4-2-13
 */

public class Index {


	//url_index maps url's to their integer codes
	private HashMap<String,Integer> url_index;
	
	//term_index maps terms to their integer codes
	private HashMap<String,Integer> term_index;
	
	//forward_edge_map maps urls to the url's they are linked to	
	private HashMap<Integer,HashSet<Integer>> forward_edge_map;
	
	//backward_edge_maps maps urls to the url's that link to them
	private HashMap<Integer,HashSet<Integer>> backward_edge_map;
	
	//forward_term_map maps urls to the terms on their page
	//and their corresponding pair frequencies
	private HashMap<Integer,HashMap<Integer,Integer>> forward_term_map;
	
	//backward_term_map maps terms to the urls that have them
	//and their corresponding pair frequencies
	private HashMap<Integer,HashMap<Integer,Integer>> backward_term_map;
	

	/**An all args constructor for the Index class
	 * not much more to say here...
	 * 
	 * @param url_index
	 * @param term_index
	 * @param forward_edge_map
	 * @param backward_edge_map
	 * @param forward_term_map
	 * @param backward_term_map
	 */
	public Index(HashMap<String, Integer> url_index,
			HashMap<String, Integer> term_index,
			HashMap<Integer, HashSet<Integer>> forward_edge_map,
			HashMap<Integer, HashSet<Integer>> backward_edge_map,
			HashMap<Integer, HashMap<Integer, Integer>> forward_term_map,
			HashMap<Integer, HashMap<Integer, Integer>> backward_term_map) {
		super();
		this.url_index = url_index;
		this.term_index = term_index;
		this.forward_edge_map = forward_edge_map;
		this.backward_edge_map = backward_edge_map;
		this.forward_term_map = forward_term_map;
		this.backward_term_map = backward_term_map;
	}
	
	/**An explicit no args constructor for the Index class
	 * not much more to say here...
	 */
	public Index(){
		
	}
	
	public HashMap<String, Integer> getUrl_index() {
		return url_index;
	}

	public void setUrl_index(HashMap<String, Integer> url_index) {
		this.url_index = url_index;
	}

	public HashMap<String, Integer> getTerm_index() {
		return term_index;
	}

	public void setTerm_index(HashMap<String, Integer> term_index) {
		this.term_index = term_index;
	}

	public HashMap<Integer, HashSet<Integer>> getForward_edge_map() {
		return forward_edge_map;
	}

	public void setForward_edge_map(
			HashMap<Integer, HashSet<Integer>> forward_edge_map) {
		this.forward_edge_map = forward_edge_map;
	}

	public HashMap<Integer, HashSet<Integer>> getBackward_edge_map() {
		return backward_edge_map;
	}

	public void setBackward_edge_map(
			HashMap<Integer, HashSet<Integer>> backward_edge_map) {
		this.backward_edge_map = backward_edge_map;
	}

	public HashMap<Integer, HashMap<Integer, Integer>> getForward_term_map() {
		return forward_term_map;
	}

	public void setForward_term_map(
			HashMap<Integer, HashMap<Integer, Integer>> forward_term_map) {
		this.forward_term_map = forward_term_map;
	}

	public HashMap<Integer, HashMap<Integer, Integer>> getBackward_term_map() {
		return backward_term_map;
	}

	public void setBackward_term_map(
			HashMap<Integer, HashMap<Integer, Integer>> backward_term_map) {
		this.backward_term_map = backward_term_map;
	}

	
	
}
